package model

import "encoding/json"

// 字典表
type Dictionary struct {
	ID      int    `json:"-" gorm:"id"`
	GroupID int    `json:"-" gorm:"group_id"`
	Label   string `json:"label" gorm:"label"`
	Value   string `json:"value" gorm:"value"`
}

func (d *Dictionary) TableName() string {
	return "ams-dictionary"
}

func (d *Dictionary) String() string {
	if dataInBytes, err := json.Marshal(&d); err == nil {
		return string(dataInBytes)
	}

	return ""
}
